package jpb.command;

import jpb.CommandArg;
import jpb.StartupCommandSelector;

import java.io.File;

/**
 * A {@link jpb.StartupCommandSelector} implementation that returns fixed pats as the startup Java command. No validation
 * is performed.
 *
 * @author Dariusz Kordonski
 */
public class FixedPathSelector implements StartupCommandSelector {

    private final CommandArg command;

    public FixedPathSelector(String command) {
        this.command = CommandArg.of(command);
    }

    public FixedPathSelector(File command) {
        this(command.getAbsolutePath());
    }

    @Override
    public CommandArg command() {
        return command;
    }
}
